package com.qianfeng.service.impl;

import com.qianfeng.mapper.UserTableMapper;
import com.qianfeng.pojo.UserTable;
import com.qianfeng.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName: UserServiceImpl
 * @Description: TODO
 * @author: Buke
 * @date: 2021-09-17 20:23:55
 * @since JDK 1.8
 */


@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserTableMapper userTableMapper;

    @Override
    public List<UserTable> findAdd() {
        return userTableMapper.selectByExample(null);
    }

    @Override
    public void deleteAll(Integer[] ids) {
        userTableMapper.deleteAll(ids);
    }

    @Override
    public List<UserTable> excel(Integer[] ids) {
        return userTableMapper.excel(ids);
    }

    @Override
    public void updateUser(UserTable userTable) {
        userTableMapper.updateByPrimaryKeySelective(userTable);
    }

    @Override
    public void deleteUserById(Integer id) {
        userTableMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void addUser(UserTable userTable) {
        userTableMapper.insertSelective(userTable);
    }
}
